package rs.dalao.syc.user.all.service.impl;/*
 *   @author:Casin
 *   @date:2023/8/13
 *   @code:
 */

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import rs.dalao.syc.common.pojo.vo.PageData;
import rs.dalao.syc.user.all.dao.persist.repository.IPrescriptionRepository;
import rs.dalao.syc.user.all.pojo.entity.Prescription;
import rs.dalao.syc.user.all.pojo.vo.PrescriptionListVO;
import rs.dalao.syc.user.all.service.IPrescriptionService;

import java.util.List;

@Service
public class PrescriptionServiceImpl implements IPrescriptionService {
    @Value("10")
    private Integer defaultQueryPageSize;
    @Autowired
    private IPrescriptionRepository repository;

    @Override
    public PageData<PrescriptionListVO> getPrescriptionByUserId(Long userId,Integer pageNum) {
        return repository.getPrescriptionByUserId(userId,pageNum,defaultQueryPageSize);
    }

    @Override
    public int update(Long id) {
        Prescription prescription=new Prescription();
        prescription.setIsDisplayUser(0);
        return repository.update(prescription,id);
    }
}
